(function(doc, win) {
    var docEl = win.document.documentElement;
    var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
    // 设置根元素font-size 当设备宽度为750px时，根元素font-size=100px; 
    var refreshRem = function() {
        var clientWidth = win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth;
        if(!clientWidth) return;
        var width = clientWidth;
        var fz = 100 * width / 750;
        docEl.style.fontSize = fz + 'px';
    };
    if(!doc.addEventListener) return;
    win.addEventListener(resizeEvt, refreshRem, false);
    doc.addEventListener('DOMContentLoaded', refreshRem, false);
    refreshRem();
})(document, window);